home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / term / vltj5867.lha / VLT / rexx / VLTPhoneBook.vlt < prev    next >
Text File  |  1994-03-27  |  4KB  |  121 lines

  1. /** VLTPhoneBook.vlt
  2. *
  3. *   This program brings up the main VLT PhoneBook requester.
  4. *
  5. *   By W.G.J. Langeveld, February 1992.
  6. *
  7. *   This program really wants to be called *from inside* VLT, so assign
  8. *   ~@VLTPhoneBook.vlt to your favorite function key, or select it from
  9. *   VLT's menu.
  10. *
  11. *   Add the libraries if they're not there yet.
  12. *
  13. **/
  14. if show("l", "rexxarplib.library") = 0 then do
  15.    check = addlib('rexxsupport.library', 0, -30, 0)
  16.    check = addlib('rexxarplib.library',  0, -30, 0)
  17. end
  18. /*
  19. *   The following sequence determines both VLT's screen and port name,
  20. *   and also gets the number screen rows and columns.
  21. */
  22. vltport = address()
  23. cols = ScreenCols(vltport)
  24. if cols == -1 then do
  25.    vltscreen = ""
  26.    cols = ScreenCols()
  27.    rows = ScreenRows()
  28. end
  29. else do
  30.    vltscreen = vltport
  31.    rows = ScreenRows(vltscreen)
  32. end
  33. /*
  34. *   Set up a host. This time, send all messages to VLT.
  35. */
  36. address AREXX "'x = CreateHost(VLTPHONEBOOK, "vltport", "vltscreen")'"
  37. /*
  38. *   Wait until it is ready.
  39. */
  40. do i = 1
  41.    if showlist('p', VLTPHONEBOOK) ~= 0 then leave
  42.    call delay 30
  43. end
  44.  
  45. call SetReqColor(VLTPHONEBOOK, BACKGROUNDPEN, 0)
  46. /*
  47. *   Open the window
  48. */
  49. idcmp = 'CLOSEWINDOW+GADGETUP+MENUPICK'
  50. flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+ACTIVATE'
  51.  
  52. call OpenWindow(VLTPHONEBOOK, cols - 260, rows - 175, 240, 168, idcmp,   ,
  53.                 flags, "VLTPhoneBook")
  54. call SetNotify(VLTPHONEBOOK, CLOSEWINDOW, VLTPHONEBOOK)
  55. /*
  56. *   Add the gadgets
  57. */
  58. call AddMenu(VLTPHONEBOOK, "Commands")
  59.  
  60. call AddItem(VLTPHONEBOOK, " Select VLT PhoneBook...",        ,
  61.              "@VLTPhoneSetup.rexx",             "P", 0)
  62.  
  63. call AddItem(VLTPHONEBOOK, " Create PhoneBook Entry...",      ,
  64.              "@VLTPhoneModify.rexx New",        "N", 0)
  65.  
  66. call AddItem(VLTPHONEBOOK, " Modify PhoneBook Entry...",      ,
  67.              "@VLTPhoneModify.rexx Modify",     "M", 0)
  68.  
  69. call AddItem(VLTPHONEBOOK, " Delete PhoneBook Entry...",      ,
  70.              "@VLTPhoneDelete.rexx",            "K", 0)
  71.  
  72. call AddItem(VLTPHONEBOOK, " Show   PhoneBook Entry...",      ,
  73.              "@VLTPhoneShow.rexx",              "V", 0)
  74.  
  75. call AddItem(VLTPHONEBOOK, " Select Entries to Dial...",      ,
  76.              "@VLTPhoneSelect.rexx",            "S", 0)
  77.  
  78. call AddItem(VLTPHONEBOOK, " Start  Dialing Sequence",        ,
  79.              "@@VLTPhoneDial.rexx "vltport,     "D", 0)
  80.  
  81. call AddItem(VLTPHONEBOOK, " Resume Dialing Sequence",        ,
  82.              "cancel $vltphone_wait resume",   "R", 0)
  83.  
  84. call AddItem(VLTPHONEBOOK, " Cancel Dialing Sequence",        ,
  85.              "cancel $vltphone_wait abort",    "C", 0)
  86.  
  87. call AddItem(VLTPHONEBOOK, " Quit",                           ,
  88.              "rx (address VLTPHONEBOOK QUIT)", "Q", 0)
  89.  
  90. call AddGadget(VLTPHONEBOOK, 10,  20, 1, " Select VLT PhoneBook...   ",    ,
  91.                "@VLTPhoneSetup.rexx")
  92.  
  93. call AddGadget(VLTPHONEBOOK, 10,  40, 2, " Create PhoneBook Entry... ",    ,
  94.                "@VLTPhoneModify.rexx New")
  95.  
  96. call AddGadget(VLTPHONEBOOK, 10,  54, 3, " Modify PhoneBook Entry... ",    ,
  97.                "@VLTPhoneModify.rexx Modify")
  98.  
  99. call AddGadget(VLTPHONEBOOK, 10,  68, 4, " Delete PhoneBook Entry... ",    ,
  100.                "@VLTPhoneDelete.rexx")
  101.  
  102. call AddGadget(VLTPHONEBOOK, 10,  82, 5, " Show   PhoneBook Entry... ",    ,
  103.                "@VLTPhoneShow.rexx")
  104.  
  105. call AddGadget(VLTPHONEBOOK, 10, 102, 6, " Select Entries to Dial... ",    ,
  106.                "@VLTPhoneSelect.rexx")
  107.  
  108. call AddGadget(VLTPHONEBOOK, 10, 122, 7, " Start  Dialing Sequence   ",    ,
  109.                "@@VLTPhoneDial.rexx "vltport)
  110.  
  111. call AddGadget(VLTPHONEBOOK, 10, 136, 8, " Resume Dialing Sequence   ",    ,
  112.                "cancel $vltphone_wait resume")
  113.  
  114. call AddGadget(VLTPHONEBOOK, 10, 150, 9, " Cancel Dialing Sequence   ",    ,
  115.                "cancel $vltphone_wait abort")
  116.  
  117. /*
  118. *   That's it. All the rest is done either directly or in other programs
  119. */
  120. exit
  121.